﻿using System;
using System.Collections.Generic;
using System.Web;
using Jint.Expressions;
using Jint;

namespace Htmlx
{
    public class ProxyCodeVisitor : IStatementVisitor
    {
        #region IJintVisitor Members

        public ProxyCodeVisitor()
        {
            PageMethods = new List<FunctionDeclarationStatement>();
        }

        public Jint.Native.JsInstance Result
        {
            get;
            set;
        }

        public List<FunctionDeclarationStatement> PageMethods { get; set; }

        public void Visit(Program expression)
        {
            foreach (Statement s in expression.ReorderStatements())
            {
                if (!(s is FunctionDeclarationStatement))
                    break;
                s.Accept(this);
            }
        }

        public void Visit(AssignmentExpression expression)
        {
            throw new NotImplementedException();
        }

        public void Visit(BlockStatement expression)
        {
            throw new NotImplementedException();
        }

        public void Visit(BreakStatement expression)
        {
            throw new NotImplementedException();
        }

        public void Visit(ContinueStatement expression)
        {
            throw new NotImplementedException();
        }

        public void Visit(DoWhileStatement expression)
        {
            throw new NotImplementedException();
        }

        public void Visit(EmptyStatement expression)
        {
            throw new NotImplementedException();
        }

        public void Visit(ExpressionStatement expression)
        {
            throw new NotImplementedException();
        }

        public void Visit(ForEachInStatement expression)
        {
            throw new NotImplementedException();
        }

        public void Visit(ForStatement expression)
        {
            throw new NotImplementedException();
        }

        public void Visit(FunctionDeclarationStatement expression)
        {
            PageMethods.Add(expression);
        }

        public void Visit(IfStatement expression)
        {
            throw new NotImplementedException();
        }

        public void Visit(ReturnStatement expression)
        {
            throw new NotImplementedException();
        }

        public void Visit(SwitchStatement expression)
        {
            throw new NotImplementedException();
        }

        public void Visit(WithStatement expression)
        {
            throw new NotImplementedException();
        }

        public void Visit(ThrowStatement expression)
        {
            throw new NotImplementedException();
        }

        public void Visit(TryStatement expression)
        {
            throw new NotImplementedException();
        }

        public void Visit(VariableDeclarationStatement expression)
        {
            throw new NotImplementedException();
        }

        public void Visit(WhileStatement expression)
        {
            throw new NotImplementedException();
        }

        public void Visit(ArrayDeclaration expression)
        {
            throw new NotImplementedException();
        }

        public void Visit(CommaOperatorStatement expression)
        {
            throw new NotImplementedException();
        }

        public void Visit(FunctionExpression expression)
        {
            throw new NotImplementedException();
        }

        public void Visit(MemberExpression expression)
        {
            throw new NotImplementedException();
        }

        public void Visit(MethodCall expression)
        {
            throw new NotImplementedException();
        }

        public void Visit(Indexer expression)
        {
            throw new NotImplementedException();
        }

        public void Visit(PropertyExpression expression)
        {
            throw new NotImplementedException();
        }

        public void Visit(PropertyDeclarationExpression expression)
        {
            throw new NotImplementedException();
        }

        public void Visit(Identifier expression)
        {
            throw new NotImplementedException();
        }

        public void Visit(JsonExpression expression)
        {
            throw new NotImplementedException();
        }

        public void Visit(NewExpression expression)
        {
            throw new NotImplementedException();
        }

        public void Visit(BinaryExpression expression)
        {
            throw new NotImplementedException();
        }

        public void Visit(TernaryExpression expression)
        {
            throw new NotImplementedException();
        }

        public void Visit(UnaryExpression expression)
        {
            throw new NotImplementedException();
        }

        public void Visit(ValueExpression expression)
        {
            throw new NotImplementedException();
        }

        public void Visit(RegexpExpression expression)
        {
            throw new NotImplementedException();
        }

        public void Visit(Statement expression)
        {
            throw new NotImplementedException();
        }

        #endregion
    }
}
